<?php
	header("Content-type:text/html;charset=utf-8");
	$userId=$_REQUEST["userId"];
	$userName=$_REQUEST["userName"];
	$userPwd=$_REQUEST["userPwd"];
	
	// $userId="12345678909";
	// $userName="马梅玲";
	// $userPwd="Mml23456";
	$conn=mysql_connect("localhost","root","root");
	mysql_select_db("jijia");
	$result=mysql_query("select * from user where userId='$userId'",$conn);
	if(mysql_num_rows($result)==1){
		echo "用户名已存在";
	}else if(mysql_query("insert into user values('$userId','$userName','$userPwd')",$conn)){
		echo "注册成功";
	}else{
		echo "注册失败";
	}
	mysql_close($conn);

?>
